package service.serviceImpl.serviceImpl;

import dao.BannerDao;
import entity.BannerEntity;
import org.springframework.stereotype.Service;
import service.serviceImpl.BannerService;

import javax.annotation.Resource;
import java.util.List;

@Service
public class BannerServiceImpl implements BannerService {

    @Resource
    private BannerDao bannerDao;

    public BannerEntity getBannerById(BannerEntity bannerEntity) {
        BannerEntity myBannerEntity = bannerDao.getBannerById(bannerEntity.getId());
        return myBannerEntity;
    }

    public List<BannerEntity> getBanner(BannerEntity bannerEntity) {
        List<BannerEntity> bannerList= bannerDao.getBanner(bannerEntity);
        return  bannerList;
    }

    public void editBanner(BannerEntity bannerEntity) {
        bannerDao.updateBanner(bannerEntity);
    }

    public void addBanner(BannerEntity bannerEntity) {
        bannerDao.addBanner(bannerEntity);
    }
}
